package org.dragonnova.lamp.utils;

/**
 * Created by hucn on 2016/10/25.
 * Description:
 */
public class ByteUtil {

    public static byte getLow4Bit(byte b) {
        return (byte) (b & 0x0F);
    }

    public static byte getHigh4Bit(byte b) {
        return (byte) ((b & 0xF0) >> 4);
    }

    public static byte mergeBytes(byte hi, byte lo) {
        return (byte) ((hi << 4) | (lo & 0x0F));
    }
}
